<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue3属性绑定指令</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.8"></script>
  </head>
  <body>
    <div id="app">
      <input type="text" v-bind:placeholder="Tips" />
      <hr />
      <!-- vue 规定v-bind指令可以简写为 ： x -->
      <img v-bind:src="photo" />
      <div :id="'list-' + num">{{ num + 1 }}</div>
      <div>{{ Tips }} 反转的结果是：{{ Tips.split('').reverse().join('') }}</div>
      <div :title="'box' + index">这是一个div</div>
    </div>

    <script>
      const vm = new Vue({
        el: "#app",
        data: {
          Tips: "请输入用户名",
          photo:
            "https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png",
          num: 1,
          index:10,
        },
      });
    </script>
  </body>
</html>
